package chap5.Task5_9;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;

public class task_随机数 {
    public static void main(String[] args) {
        HashSet<Integer> hashSet=new HashSet<Integer>();
        while(hashSet.size()<10){
            Random rand=new Random();
            int a = rand.nextInt(40) + 1;
            hashSet.add(a);
        }
        Iterator iterator=hashSet.iterator();
        while(iterator.hasNext()){
            System.out.print(iterator.next()+"\t");
        }
    }
}
